#include "SMPPNetworkErrorCode.hpp"

using namespace smpp::pdu;

NetworkErrorCode::NetworkErrorCode(const octetString &nValue):
TLV(TLVtags::TAG_NETWORK_ERROR_CODE,nValue.size()),_Value(nValue){}

NetworkErrorCode::NetworkErrorCode(
const NetworkErrorCode &nNetworkErrorCode):
TLV(nNetworkErrorCode),_Value(nNetworkErrorCode.getValue()){}

bool NetworkErrorCode::operator ==(
	const NetworkErrorCode &nNetworkErrorCode) const{
	return (TLV::operator == (nNetworkErrorCode) && 
			_Value == nNetworkErrorCode.getValue());
}

bool NetworkErrorCode::operator !=(
	const NetworkErrorCode &nNetworkErrorCode) const{
	return !this->operator == (nNetworkErrorCode);
}

NetworkErrorCode &NetworkErrorCode::operator = (
	const NetworkErrorCode &nNetworkErrorCode){
	if(*this == nNetworkErrorCode)
		return *this;
	TLV::operator = (nNetworkErrorCode);
	_Value = nNetworkErrorCode.getValue();
	return *this;
}

void NetworkErrorCode::setValue(const octetString &nValue){
	_Value = nValue;
}

const octetString &NetworkErrorCode::getValue() const{
	return _Value;
}
